﻿using ChurchDiary.DAL.Contract;
using ChurchDiary.DAL.Methods;
using ChurchDiary.TableEntity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChurchDiary.BLL
{
    public class BLL_ChurchWorker
    {
        #region Documents
        public string InsertDocument(EntityDocuments Document)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertDocument(Document);
        }
        public string UpdateDocument(EntityDocuments Document)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateDocument(Document);
        }
        public string DeleteDocument(Guid DocumentId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteDocument(DocumentId);
        }
        public List<EntityDocuments> GetDocuments(int PageNo, string SearchKey,string Sort,string SortMode)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetDocuments(PageNo, SearchKey, Sort, SortMode);
        }
        public List<EntityDocuments> GetDocuments()
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetDocuments();
        }
        public EntityDocuments GetDocument(Guid DocumentId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetDocument(DocumentId);
        }
        #endregion
        #region Church Worker Designation
        public string InsertChurchWorkerDesignation(EntityChurchWorkerDesignation ChurchWorkerDesignation)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerDesignation(ChurchWorkerDesignation);
        }
        public string UpdateChurchWorkerDesignation(EntityChurchWorkerDesignation ChurchWorkerDesignation)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorkerDesignation(ChurchWorkerDesignation);
        }
        public string DeleteChurchWorkerDesignation(Guid ChurchWorkerDesignationId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerDesignation(ChurchWorkerDesignationId);
        }
        public List<EntityChurchWorkerDesignation> GetChurchWorkerDesignation(int PageNo, string SearchKey, string Sort, string SortMode)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerDesignation(PageNo,SearchKey,Sort,SortMode);
        }
        public List<EntityChurchWorkerDesignation> GetChurchWorkerDesignation()
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerDesignation();
        }
        public EntityChurchWorkerDesignation GetChurchWorkerDesignation(Guid ChurchWorkerDesignationId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerDesignation(ChurchWorkerDesignationId);
        }
        #endregion
        #region ChurchWorker
        public DataTable GetChurchWorkerFullDetailsSet(Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerFullDetailsSet(ChurchWorkerId);
        }
        public EntityChurchWorker GetChurchWorkerFullDetails(Guid ChurchWorkerID)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerFullDetails(ChurchWorkerID);
        }
        public string InsertChurchWorker(EntityChurchWorker ChurchWorker)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorker(ChurchWorker);
        }
        public string UpdateChurchWorker(EntityChurchWorker ChurchWorker)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorker(ChurchWorker);
        }
        public string DeleteChurchWorker(Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorker(ChurchWorkerId);
        }
        public List<EntityChurchWorker> GetChurchWorker(int PageNo, string SearchKey, string Sort, string SortMode,int PerPage)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorker(PageNo, SearchKey, Sort, SortMode, PerPage);
        }

        public List<EntityChurchWorker> GetChurchWorker()
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorker();
        }

        public EntityChurchWorker GetChurchWorker(Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorker(ChurchWorkerId);
        }
        #endregion
        #region NameTitle
        public string InsertNameTitle(EntityNameTitle NameTitle)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertNameTitle(NameTitle);
        }
        public string UpdateNameTitle(EntityNameTitle NameTitle)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateNameTitle(NameTitle);
        }
        public string DeleteNameTitle(Guid NameTitleId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteNameTitle(NameTitleId);
        }
        public List<EntityNameTitle> GetNameTitle(int PageNo, string SearchKey, string Sort, string SortMode)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetNameTitle(PageNo, SearchKey, Sort, SortMode);
        }
        public EntityNameTitle GetNameTitle(Guid NameTitleId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetNameTitle(NameTitleId);
        }
        public List<EntityNameTitle> GetNameTitle()
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetNameTitle();
        }
        #endregion
        #region Church Worker Status
        public List<EntityChurchWorkerStatus> GetChurchWorkerStatus(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerStatus(PageNo, SearchKey, Sort, SortMode, PerPage);
        }
        public EntityChurchWorkerStatus GetChurchWorkerStatus(Guid ChurchWorkerStatusId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerStatus(ChurchWorkerStatusId);
        }
        public List<EntityChurchWorkerStatus> GetChurchWorkerStatus()
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerStatus();
        }
        public string InsertChurchWorkerStatus(EntityChurchWorkerStatus ChurchWorkerStatus)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerStatus(ChurchWorkerStatus);
        }
        public string UpdateChurchWorkerStatus(EntityChurchWorkerStatus ChurchWorkerStatus)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorkerStatus(ChurchWorkerStatus);
        }
        public string DeleteChurchWorkerStatus(Guid ChurchWorkerStatusId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerStatus(ChurchWorkerStatusId);
        }
        #endregion
        #region ChurchWorkerJobtitle
        public string InsertChurchWorkerJobtitle(EntityChurchWorkerJobtitle Jobtitle)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerJobtitle(Jobtitle);
        }
        public List<EntityChurchWorkerJobtitle> GetChurchWorkerJobtitle(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerJobtitle(PageNo, SearchKey, Sort, SortMode, PerPage);
        }
        #endregion
        #region ChurchWorker Family
        public string InsertChurchWorkerfamily(EntityChurchWorkerFamilyDetails ChurchWorkerfamily)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerfamily(ChurchWorkerfamily);
        }
        public string UpdateChurchWorkerfamily(EntityChurchWorkerFamilyDetails ChurchWorkerfamily)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorkerfamily(ChurchWorkerfamily);
        }
        public string DeleteChurchWorkerfamily(Guid ChurchWorkerfamilyId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerfamily(ChurchWorkerfamilyId);
        }
        public List<EntityChurchWorkerFamilyDetails> GetChurchWorkerFamily(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage, Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerFamily(PageNo,SearchKey,Sort,SortMode,PerPage,ChurchWorkerId);
        }
        public EntityChurchWorkerFamilyDetails GetChurchWorkerFamily(Guid ChurchWorkerFamilyId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerFamily(ChurchWorkerFamilyId);
        }
        #endregion
        #region ChurchWorker Document
        public List<EntityChurchWorkerDocuments> GetChurchWorkerDocuments(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage, Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerDocuments(PageNo, SearchKey, Sort, SortMode, PerPage, ChurchWorkerId);
        }
        public EntityChurchWorkerDocuments GetChurchWorkerDocuments(Guid ChurchWorkerDocumentsId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerDocuments(ChurchWorkerDocumentsId);
        }
        public string InsertChurchWorkerDocuments(EntityChurchWorkerDocuments ChurchWorkerDocuments)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerDocuments(ChurchWorkerDocuments);
        }
        public string UpdateChurchWorkerDocuments(EntityChurchWorkerDocuments ChurchWorkerDocuments)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorkerDocuments(ChurchWorkerDocuments);
        }
        public string DeleteChurchWorkerDocuments(Guid ChurchWorkerDocumentsId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerDocuments(ChurchWorkerDocumentsId);
        }
        #endregion
        #region ChurchWorker Knownlanguages
        public List<EntityChurchWorkerKnownlanguages> GetChurchWorkerKnownlanguages(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage, Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerKnownlanguages(PageNo, SearchKey, Sort, SortMode, PerPage, ChurchWorkerId);
        }
        public EntityChurchWorkerKnownlanguages GetChurchWorkerKnownlanguages(Guid ChurchWorkerKnownlanguagesId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerKnownlanguages(ChurchWorkerKnownlanguagesId);
        }
        public string InsertChurchWorkerKnownlanguages(EntityChurchWorkerKnownlanguages ChurchWorkerKnownlanguages)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerKnownlanguages(ChurchWorkerKnownlanguages);
        }
        public string UpdateChurchWorkerKnownlanguages(EntityChurchWorkerKnownlanguages ChurchWorkerKnownlanguages)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorkerKnownlanguages(ChurchWorkerKnownlanguages);
        }
        public string DeleteChurchWorkerKnownlanguages(Guid ChurchWorkerKnownlanguagesId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerKnownlanguages(ChurchWorkerKnownlanguagesId);
        }
        #endregion
        #region ChurchWorker History
        public List<EntityChurchWorkerHistroy> GetChurchWorkerHistroy(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage, Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerHistroy(PageNo, SearchKey, Sort, SortMode, PerPage, ChurchWorkerId);
        }
        public EntityChurchWorkerHistroy GetChurchWorkerHistroy(Guid ChurchWorkerHistroyId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerHistroy(ChurchWorkerHistroyId);
        }
        public string InsertChurchWorkerHistroy(EntityChurchWorkerHistroy ChurchWorkerHistroy)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.InsertChurchWorkerHistroy(ChurchWorkerHistroy);
        }
        public string UpdateChurchWorkerHistroy(EntityChurchWorkerHistroy ChurchWorkerHistroy)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.UpdateChurchWorkerHistroy(ChurchWorkerHistroy);
        }
        public string DeleteChurchWorkerHistroy(Guid ChurchWorkerHistroyId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerHistroy(ChurchWorkerHistroyId);
        }
        #endregion
        #region ChurchWorker Designation
        public List<EntityChurchWorkerOrdinations> GetChurchWorkerOrdination(Guid ChurchWorkerId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.GetChurchWorkerOrdination(ChurchWorkerId);
        }
        public string InsertChurchWorkerOrdinations(List<EntityChurchWorkerOrdinations> Ordinations)
        {
            string Result = "SME";
            try
            {
                IDALChurchWorker Ch = new DAL_ChurchWorker();
                foreach (EntityChurchWorkerOrdinations Ordination in Ordinations)
                {
                    Ch.InsertChurchWorkerOrdinations(Ordination);
                }
                Result = "USUS";
            }
            catch (Exception ex)
            {
                Result = "SME";
            }
            return Result;
        }
        public string DeleteChurchWorkerOrdinations(Guid OrdinationId)
        {
            IDALChurchWorker Ch = new DAL_ChurchWorker();
            return Ch.DeleteChurchWorkerOrdinations(OrdinationId);
        }
        #endregion
    }
}
